@use "scss/colors";
@use "scss/variables";
@use "scss/z-indices";

$border-radius: variables.$border-radius-lg;

// ------- <table/> --------
.table {
  border-spacing: 0;
  width: 100%;
  max-width: 100%;
  border-radius: $border-radius;

  &--default {
    box-shadow: variables.$box-shadow;
  }
}

.thead--sticky {
  position: sticky;
  top: 0;
  z-index: z-indices.$tableScroll;
}

// --------- <th/> ---------
.th {
  color: colors.$grey-500;
  text-transform: uppercase;
  border-bottom: none;
  text-align: left;
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  width: auto;
  padding: variables.$spacing-md variables.$spacing-lg;
  white-space: nowrap;

  &--sorted {
    color: colors.$blue;
  }

  &--default {
    background-color: colors.$grey-30;
  }

  &--light {
    background-color: colors.$grey-50;
    color: colors.$grey;
    text-transform: capitalize;
    font-size: 11px;
    font-weight: 400;
  }

  &--white {
    background-color: colors.$foreground;
  }

  &--inBlock {
    text-transform: none;
    background-color: colors.$foreground;
    font-size: variables.$font-size-sm;
    font-weight: normal;
    border-bottom: variables.$border-thin solid colors.$grey-50;
  }

  &:first-child {
    border-radius: $border-radius 0 0;
  }

  &:last-child {
    padding-left: variables.$spacing-lg;
    border-radius: 0 $border-radius 0 0;
  }

  > button {
    padding: 0;
  }
}

// --------- <tr/> ---------
.tr {
  background-color: colors.$foreground;
  cursor: auto;

  &:hover {
    background-color: colors.$grey-50;
  }

  &.emptyPlaceholder {
    height: 400px;

    &:hover {
      background-color: colors.$foreground;
    }
  }
}

// --------- <td/> ---------

.td {
  padding: variables.$spacing-md variables.$spacing-lg;
  font-size: variables.$font-size-sm;
  line-height: 1.2;
  font-weight: normal;
  color: colors.$dark-blue;
  word-wrap: break-word;
  border-bottom: variables.$border-thin solid colors.$grey-50;
  width: auto;

  &--responsive {
    max-width: 0;
  }

  &--noPadding {
    padding: 0;
  }

  tr:last-child > & {
    border-bottom: none;

    &:first-child {
      border-radius: 0 0 0 $border-radius;
    }

    &:last-child {
      border-radius: 0 0 $border-radius;
    }
  }
}
